package com.modificial.swagger;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author modificial
 * @date 2018/7/31
 * @company codingApi
 * @description swagger配置类
 */
@ConfigurationProperties(prefix = "spring.swagger")
public class SwaggerProperties {
    /**
     * 扫描包路径
     */
    private String scanPackage;
    /**
     * 请求主机地址
     */
    private String host="127.0.0.1:8080";
    /**
     * Swagger标题
     */
    private String title = "Swagger-UI";
    /**
     * 描述信息
     */
    private String description = "接口文档";
    /**
     * 版本号
     */
    private String version = "1.0.0";
    /**
     * 个人url地址
     */
    private String termsOfServiceUrl = "https://www.codingapi.com";
    /**
     * 是否启用全局参数
     */
    private  boolean useGlobalOperationParameters=false;
    /**
     * 联系信息
     */
    private SwaggerProperties.Contact contact;

    public String getScanPackage() {
        return scanPackage;
    }

    public void setScanPackage(String scanPackage) {
        this.scanPackage = scanPackage;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getTermsOfServiceUrl() {
        return termsOfServiceUrl;
    }

    public void setTermsOfServiceUrl(String termsOfServiceUrl) {
        this.termsOfServiceUrl = termsOfServiceUrl;
    }

    public SwaggerProperties.Contact getContact() {
        return this.contact;
    }

    public void setContact(SwaggerProperties.Contact contact) {
        this.contact = contact;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public boolean isUseGlobalOperationParameters() {
        return useGlobalOperationParameters;
    }

    public void setUseGlobalOperationParameters(boolean useGlobalOperationParameters) {
        this.useGlobalOperationParameters = useGlobalOperationParameters;
    }

    /**
     * 原来的没有空构造器所以做一个类
     *
     * @see springfox.documentation.service.Contact
     */
    public static class Contact {

        private String name;
        private String url;
        private String email;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getEmail() {
            return email;
        }

        public void setEmail(String email) {
            this.email = email;
        }
    }
}

